1. Field of Invention
The present invention relates to a control of flash storage card. More particularly, the present invention relates to a method of state maintenance for flash storage card in control.
2. Description of Related Art
A flash storage card, such as the MultiMediaCard (MMC)/Secure Digital Card (SD) is a universal low cost data storage and communication media. It is designed to cover a wide area of applications as electronic toys, organizers, PDAs, cameras, smart phones, digital recorders. MP3 players, pagers, etc. Targeted features are high mobility and high performance at a low cost price. It might also be expressed in terms of low power consumption and high data throughput at the memory card interface. The MMC communication is based on an advanced 7-pin serial bus designed to operate in a low voltage range. The communication protocol is defined as a part of this standard and referred to as MMC mode.
The MMC/SD now is more and more popular in the market. Since the MMC Card's MMC mode can accept multiple cards for transferring and receiving data, the communication protocol should manage multiple cards using several commands for different situations. FIG. 1 is a block diagram, schematically illustrating the MMC Card MMC Mode state diagram in data transfer mode.
In FIG. 1, the operation is basically at the interrupt mode or the data transfer mode. The commands are denoted in the square block starting with CMD. The commands CMD's have been defined in the MMC standard. However, in order to transfer data, there several states 100-110 indicated by the elliptic blocks. Usually, it has the stand-by state 102, transfer state 104, sending-data state 106, receive-data state 108, programming state 110, and disconnect state 112. For the specific state, only some commands can be used, so as to allow the data to be transferred and correctly received between the host and the selected one of the multiple cards.
For example, CMD7 is used to select one card and put it into the transfer state 104. Only one card can be in the transfer state at a given time. If a previously selected card is in the transfer state 104, its connection with the host is released and it will move back to the stand-by state 102. When the command CMD7 is issued with the reserved relative card address “0x0000”, all cards are put back to stand-by state. This may be used before identifying new cards without resetting other already registered cards. Cards, which already have a relative card address (RCA), do not respond to identification commands (CMD1, CMD2, CMD3) in this state.
All data communication in the data transfer mode is point-to point between the host and the selected card (using addressed commands). All addressed commands get acknowledged by a response on the CMD line.
According to MMC/SD spec, the memory working voltage is at the range of 2.7 V-3.6 V or 1.65V-1.95V. However, the working voltage may have fluctuation and drops less than a certain level. However, the host may do not know that the working voltage has dropped down a level, at which the data cannot be properly transmitted in flash storage Card, and still keep the transmission state. For this conventional situation, operation of the system may cause a hand up.
FIG. 2 is a timing diagram, schematically illustration the occurrence of hand up situation in the conventional operation for transmitting data. In FIG. 2, when the host intends to write data to MMC/SD, the host state 206 goes through a series of states including idle state (xIDLE), ready state (xReady), identification state (xIDENT), stand-by state (xSTBY), transfer state (xTRAN), and receiving data state (xRCV). During the transfer state, the command CMD25 is issued to write multiple block data. Then, data 210 is transmitted.
However, the working voltage VCC 200 may have fluctuation, for example, occurring at the receiving state (xRCV). When the working voltage is less than a preset voltage level, such as 2.55 V. The low voltage detection (LVD) 202 signal, corresponding to the preset voltage level, drops to a low level in response to the VCC 200. When the working voltage level rises again over the preset voltage level, the LVD signal goes to the high level again. When the LVD goes to the low level, a firmware reset signal 204 at high level is issued, so as to stop the write operation to the flash memory. When the working voltage returns back to the acceptable voltage range, the firmware reset signal 204 returns to the low level and resets the firmware to the initial status.
However, since the host does not known that the firmware has been reset, the status for the data 210 remains at the busy status. If the host doesn't issue a command CMD12, the MMC/SD cannot receive more data and the host cannot pull up the busy signal since the firmware reset 204 doesn't set next SRAM bank for data transfer. The card always remains in the xRCV state. Usually, when the host does not receive data for a period of timeout, a command CMD12 is issued to change to the programming state PRG. However, the card still cannot go back to the xTRAN state since the firmware has been reseted and ignores the CMD12. The firmware will not set PRG_OPERATION_OK. The busy signal still cannot be pulled up. The card stays at the PRG state and is always busy.
Therefore, in the conventional operation based on MMC spec, voltage fluctuation may cause a hand up for the system.